package com.cleaningcloud.cld.mapper;

import java.util.List;
import com.cleaningcloud.cld.domain.CldTrainIecturer;
import com.cleaningcloud.cld.domain.dto.CldTrainIecturerDto;
import com.cleaningcloud.cld.domain.vo.CldTrainIecturerVo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

/**
 * 培训讲师Mapper接口
 * 
 * @author cleaningcloud
 * @date 2024-10-22
 */
public interface CldTrainIecturerMapper 
{
    /**
     * 查询培训讲师
     * 
     * @param trainIecturerId 培训讲师主键
     * @return 培训讲师
     */
    CldTrainIecturerVo selectCldTrainIecturerByTrainIecturerId(Long trainIecturerId);

    /**
     * 查询培训讲师列表
     * 
     * @param cldTrainIecturer 培训讲师
     * @return 培训讲师集合
     */
    List<CldTrainIecturerVo> selectCldTrainIecturerList(CldTrainIecturerDto cldTrainIecturer);

    /**
     * 新增培训讲师
     * 
     * @param cldTrainIecturer 培训讲师
     * @return 结果
     */
    int insertCldTrainIecturer(CldTrainIecturer cldTrainIecturer);

    /**
     * 修改培训讲师
     * 
     * @param cldTrainIecturer 培训讲师
     * @return 结果
     */
    int updateCldTrainIecturer(CldTrainIecturer cldTrainIecturer);

    /**
     * 删除培训讲师
     * 
     * @param trainIecturerId 培训讲师主键
     * @return 结果
     */
    int deleteCldTrainIecturerByTrainIecturerId(Long trainIecturerId);

    /**
     * 批量删除培训讲师
     * 
     * @param trainIecturerIds 需要删除的数据主键集合
     * @return 结果
     */
    int deleteCldTrainIecturerByTrainIecturerIds(Long[] trainIecturerIds);


    /**
     * 根据员工id查询培训讲师
     * @param staffId
     * @return
     */
    CldTrainIecturer selectCldTrainIecturerByStaffId(@Param("staffId") Long staffId);


    @Update("update cld_train_iecturer set status = 0 , un_iecturer_time = sysdate() where staff_id = #{staffId}")
    void unbindingCldTrainIecturerByStaffId(@Param("staffId") Long staffId);
}
